package self.example.explore.dao;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import self.example.explore.po.Dept;
import self.example.explore.po.DeptExample;

public interface DeptMapper {
    long countByExample(DeptExample example);

    int deleteByExample(DeptExample example);

    @Delete({
        "delete from dept",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into dept (id, dep_name, ",
        "addr)",
        "values (#{id,jdbcType=INTEGER}, #{depName,jdbcType=VARCHAR}, ",
        "#{addr,jdbcType=VARCHAR})"
    })
    int insert(Dept row);

    int insertSelective(Dept row);

    List<Dept> selectByExample(DeptExample example);

    @Select({
        "select",
        "id, dep_name, addr",
        "from dept",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("self.example.explore.dao.DeptMapper.BaseResultMap")
    Dept selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("row") Dept row, @Param("example") DeptExample example);

    int updateByExample(@Param("row") Dept row, @Param("example") DeptExample example);

    int updateByPrimaryKeySelective(Dept row);

    @Update({
        "update dept",
        "set dep_name = #{depName,jdbcType=VARCHAR},",
          "addr = #{addr,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Dept row);
}